package com.future.myjavatools.core.zhoupu;

/**
 *
* @author  tangdingyi  E-mail: 13913364179@163.com
* @date 创建时间：2018年1月3日 上午10:40:01
* @version 1.0 *
* @since
 */
public class MD5SelfPasswordEncoder {

	public static final String CODE = "*g#ab$7#zhoupuWMs";

	private Md5PasswordEncoder encoder = new Md5PasswordEncoder();

	public boolean matches(CharSequence rawPassword, String encodedPassword) {
		return encoder.isPasswordValid(encodedPassword, rawPassword.toString(), CODE);
	}


	public String encode(CharSequence rawPassword) {
		return encoder.encodePassword(rawPassword.toString(), CODE);
	}

	public boolean matchesNotSalt(String encodedInput, String encodedPassword) {
		return encodedInput.equals(encodedPassword);
	}

	public static void main(String[] args) {
		System.out.println(new MD5SelfPasswordEncoder().encode("aA111111"));
	}
}
